﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class CharacterController : MonoBehaviour {

	private string chars = 
		"AAAAAAAAAAA" + 
		"BB" + 
		"CCCCC" + 
		"DDDD" + 
		"EEEEEEEEE" +
		"FF" +
		"GG" +
		"H" +
		"IIIIIIIIII" +
		"J" +
		"LLLL" +
		"MMM" +
		"NNNNNN" +
		"OOOOO" +
		"PPPP" +
		"RRRRRRR" +
		"SSSSS" +
		"TTTTTTT" +
		"UUUUUU" +
		"VV" +
		"X" +
		"Z" +
		"??";
	
	private Dictionary<string, int> scores = new Dictionary<string, int> {
		{"A", 1}, {"B", 9}, {"C", 1}, {"D", 2}, {"E", 1}, {"F", 8}, {"G", 9}, {"H", 10}, {"I", 1}, {"J", 10},
		{"L", 1}, {"M", 4}, {"N", 6}, {"O", 1}, {"P", 2}, {"R", 1}, {"S", 1}, {"T", 1}, {"U", 1}, {"V", 8},
		{"X", 10}, {"Z", 10}, {"?", 0}
	};

	void Start () {
		int idx = (int) (Random.value * (float) chars.Length);
		string character = chars[idx] + "";
		string score = scores[character] + "";
		GetComponent<TextMesh>().text = character;
		transform.parent.Find("CharScore").GetComponent<TextMesh>().text = score;	
	}

}

